from django.shortcuts import render
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer

from home.models import  Bed, Hotel, Order




class BedSerializer(ModelSerializer):
    class Meta:
        model = Bed
        fields = '__all__'


class HotelSerializer(ModelSerializer):
    class Meta:
        model = Hotel
        fields = '__all__'


class OrderSerializer(ModelSerializer):
    hotel = serializers.CharField(source='hotel.name')
    bed = serializers.CharField(source='bed.name')
    class Meta:
        model = Order
        fields = '__all__'
